<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/firstdemo/CSS/w3.css">
<link rel="stylesheet" href="/firstdemo/CSS/google.css">
<link rel="stylesheet" href="/firstdemo/fontawesome/css/all.css">
<style>
    html,body,h1,h2,h3,h4,h5 {font-family: "Raleway", sans-serif}
    a{TEXT-DECORATION:none}
</style>

<script type="text/javascript" src="/firstdemo/JS/pageLogic.js"></script>
<head>
    <base href="<%=basePath%>">
    <title>管理员页面</title>
</head>
<body class="w3-light-grey">

<!-- Top container -->
<div class="w3-bar w3-top w3-teal w3-large" style="z-index:4">
    <button class="w3-bar-item w3-button w3-hide-large w3-hover-none w3-hover-text-light-grey" onclick="w3_open();"><i class="fa fa-bars"></i>  Menu</button>
    <span class="w3-bar-item w3-right">Logo</span>
</div>

<!-- Sidebar/menu -->
<nav class="w3-sidebar w3-collapse w3-white w3-animate-left" style="z-index:3;width:300px;" id="mySidebar"><br>
    <div class="w3-container w3-row">
        <div class="w3-col s4">
            <img src="/firstdemo/images/avatar2.png" class="w3-circle w3-margin-right" style="width:46px">
        </div>
        <div class="w3-col s8 w3-bar">
            <span>Welcome, <strong><%=request.getAttribute("username")%></strong></span><br>
            <a  class="w3-bar-item w3-button"><i class="fa fa-envelope"></i></a>
            <a  class="w3-bar-item w3-button"><i class="fa fa-user"></i></a>
            <a  class="w3-bar-item w3-button"><i class="fa fa-cog"></i></a>
        </div>
    </div>
    <hr>
    <div class="w3-container">
        <h5>Dashboard</h5>
    </div>
    <div class="w3-bar-block">
        <a  class="w3-bar-item w3-button w3-padding-16 w3-hide-large w3-dark-grey w3-hover-black" onclick="w3_close()" title="close menu"><i class="fa fa-remove fa-fw"></i>  Close Menu</a>
        <a  class="w3-bar-item w3-button w3-padding" id="lookupbar"><i class="fa fa-eye fa-fw"></i>
              <botton id = "lookup">查询</botton></a>

        <a  class="w3-bar-item w3-button w3-padding" id="postbar" ><i class="fa fa-eye fa-fw" ></i>
              <botton id = "post">公告</botton></a>

        <a  class="w3-bar-item w3-button w3-padding" id="userlistbar" href="FindUserList" target="_blank"><i class="fa fa-users fa-fw"></i>
              <botton id = "userlist">查看所有用户</botton></a>

        <a  class="w3-bar-item w3-button w3-padding" id="pptbar" ><i class="far fa-gem"></i>
              <botton id = "ppt">上传课件</botton></a>

        <a  class="w3-bar-item w3-button w3-padding" id="commentbar" ><i class="fa fa-bell fa-fw"></i>
              <botton id = "comment">成绩</botton></a>

        <a  class="w3-bar-item w3-button w3-padding" id="quitbar" href="BacktoLogin"><i class="fa fa-history fa-fw"></i>
              <botton id = "quit">退出用户</botton></a>

        <a  class="w3-bar-item w3-button w3-padding" id="infobar"><i class="fa fa-cog fa-fw"></i>
              <botton id = "info">Info</botton></a><br><br>
    </div>
</nav>


<!-- Overlay effect when opening sidebar on small screens -->
<div class="w3-overlay w3-hide-large w3-animate-opacity" onclick="w3_close()" style="cursor:pointer" title="close side menu" id="myOverlay"></div>

<!-- !PAGE CONTENT! -->
<div class="w3-main" style="margin-left:300px;margin-top:43px;">

    <!-- Header -->
    <header class="w3-container" style="padding-top:22px">
        <h5><b><i class="fa fa-dashboard"></i> My Dashboard</b></h5>
    </header>

    <!-- $# lookup -->
    <form action="SelectUserList"method="post" >
        <input type="hidden" value=${username} name="username" style="display: none" >
        <div id = "alter1" class="w3-margin-bottom" >
            <div id = "alter11" class="w3-row-padding" >
                <div class="w3-quarter" data-tilt>
                    <div class="w3-container w3-red w3-padding-16" style="height: 150px">
                        <div class="w3-right"><i class="fa fa-comment w3-xxxlarge"></i></div>
                        <div class="w3-left">
                            <h3>输入ID</h3>
                        </div>
                        <div class="w3-clear"></div>
                        <input class="w3-input w3-text" name="id" type="text">
                    </div>
                </div>
                <div class="w3-quarter" data-tilt>
                    <div class="w3-container w3-blue w3-padding-16" style="height: 150px">
                        <div class="w3-right"><i class="fa fa-eye w3-xxxlarge"></i></div>
                        <div class="w3-left">
                            <h3>输入用户名</h3>
                        </div>
                        <div class="w3-clear"></div>
                        <input class="w3-input w3-text" name="name" type="text">
                    </div>
                </div>
            </div>

            <div class="w3-padding-16"></div>

            <div id = "alter12" class="w3-row-padding" >
                <div class="w3-quarter" data-tilt>
                    <div class="w3-container w3-teal w3-padding-16" style="height: 150px">
                        <div class="w3-right"><i class="fa fa-share-alt w3-xxxlarge"></i></div>
                        <div class="w3-left">
                            <h3>选择性别</h3>
                        </div>
                        <div class="w3-clear"></div>
                        <div class="w3-bar">
                            <input class="w3-radio" type="radio" name="sex" value="男" checked><lable>男</lable>
                            <input class="w3-radio" type="radio" name="sex" value="女"><label>女</label>
                        </div>
                    </div>
                </div>
                <div class="w3-quarter" data-tilt>
                    <div class="w3-container w3-orange w3-text-white w3-padding-16" style="height: 150px">
                        <div class="w3-right"><i class="fa fa-users w3-xxxlarge"></i></div>
                        <div class="w3-left">
                            <h3>选择家乡</h3>
                        </div>
                        <div class="w3-clear"></div>
                        <select class="w3-select" name="home" style="width: 60%">
                            <option value="" disabled selected>选择家乡</option>
                            <option value="上海">上海</option>
                            <option value="北京">北京</option>
                            <option value="纽约">纽约</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="w3-padding-32"></div>
            <div class="w3-bar w3-row-padding ">
                <div class="w3-bar-item " style="width:10%">
                    <button class="w3-button w3-input w3-teal " type="submit"value="查询">查询</button>
                </div>
                <div class="w3-bar-item " style="width:10%">
                    <button class="w3-button w3-input w3-red " type="reset"value="重置">重置</button>
                </div>
            </div>
        </div>

    </form>
    <!-- $# post list -->
    <div id = "alter2" class="w3-panel" display = "none">
        <div id = "alter21" class="w3-margin-bottom" >
            <div class="w3-bar w3-row-padding w3-xxlarge" >
                <div class="w3-quarter"  data-tilt>
                    <form action="GetPoster" method="post" target="_blank">
                        <div class="w3-container w3-blue w3-padding-16" style="height: 150px" >
                            <input  name="username" value="${username}" style="display: none">
                            <input class=" w3-input w3-blue w3-text-white w3-xxxlarge" type="submit" value="查看公告" >
                        </div>
                    </form>
                </div>
                <form action="AddPoster"method="post" target="_blank">
                    <div class="w3-quarter" data-tilt>
                        <div class="w3-container w3-red w3-padding-16" style="height: 150px">
                            <div class="w3-right"><i class="fa fa-comment w3-xxxlarge"></i></div>
                            <div class="w3-left">
                                <h3>输入新公告</h3>
                            </div>
                            <div class="w3-clear"></div>
                            <input  name="username" value="${username}" style="display: none">
                            <input class="w3-input w3-text" name="str" type="text" >
                        </div>
                    </div>
                    <div class="w3-quarter" data-tilt>
                        <div class="w3-container w3-orange w3-padding-16" style="height: 150px">
                            <input class=" w3-input w3-orange w3-text-white w3-xxxlarge" type="submit" value="确认增加" >
                        </div>
                    </div>
                </form>
            </div>
        </div>



    </div>
    <hr>
    <!-- $# user list -->
    <div id = "alter3" class="w3-container">

    </div>
    <hr>
    <!-- $# user lists ppt -->
    <div id = "alter4" class="w3-container">
<%--        <form action="Upload" method="post" enctype="multipart/form-data">--%>
<%--            <input type="hidden" value=${username} name="username"><br><br>--%>
<%--            上传文件：<input type="SFile" name="spicture"><br><br>--%>
<%--            <input type="submit" value="上传"><br><br>--%>
<%--        </form>--%>
        <div class="w3-row-padding">
        <form action="Upload" method="post" enctype="multipart/form-data">
            <input type="hidden" value=${username} name="username" style="display: none">
            <div class="w3-quarter" data-tilt>
                <div class="w3-container w3-red w3-padding-16" style="height: 150px">
                    <div class="w3-right"><i class="fa fa-envelope w3-xxxlarge"></i></div>
                    <div class="w3-left">
                        <h2>上传文件</h2>
                    </div>
                    <div class="w3-clear"></div>
                    <input class="w3-input" type="file" name="spicture">
                </div>
            </div>
            <div class="w3-quarter" data-tilt>
                <div class="w3-container w3-orange w3-padding-16 w3-text-white" style="height: 150px">
                    <div class="w3-right"><i class="fa fa-lock w3-xxxlarge"></i></div>
                    <input class=" w3-input w3-orange w3-text-white w3-xlarge" type="submit" value="确认上传" >
                </div>
            </div>
        </form>

        </div>
    <form action="AllFile" method="post" target="_blank">
        <div class="w3-quarter" data-tilt>

            <input type="hidden" value=${username} name="username"><br><br>
            <div class="w3-container w3-teal w3-padding-16" style="height: 150px">

                <div class="w3-right"><i class="fa fa-lock w3-xxxlarge"></i></div>
                <input class=" w3-input w3-teal w3-text-white w3-xlarge" type="submit" value="查看所有文件" >
            </div>

        </div>
    </form>
        <div class="w3-row-padding">
<%--            <form action="AllFile"method="post" style="padding-top:-700px;">--%>
<%--                <input type="hidden" value=${username} name="username"><br><br>--%>
<%--                <input type="submit" value="查看所有文件"><br><br>--%>
<%--            </form>--%>
            <h5>课件</h5>
            <table class="w3-table w3-striped w3-bordered w3-border w3-hoverable w3-white">
            <tr>
                <td>United States</td>
                <td>65%</td>
            </tr>
            <tr>
                <td>UK</td>
                <td>15.7%</td>
            </tr>
            <tr>
                <td>Russia</td>
                <td>5.6%</td>
            </tr>
            <tr>
                <td>Spain</td>
                <td>2.1%</td>
            </tr>
            <tr>
                <td>India</td>
                <td>1.9%</td>
            </tr>
            <tr>
                <td>France</td>
                <td>1.5%</td>
            </tr>
        </table><br>
            <button class="w3-button w3-dark-grey">More Countries  <i class="fa fa-arrow-right"></i></button>

        </div>

    </div>
    <hr>

    <!-- $# grade -->
    <div id = "alter5" class="w3-container">
        <div class="w3-row-padding">
            <form action="AddGrade" method="post" target="_blank">
                <h2>添加成绩</h2>
                <div class="w3-bar w3-row-padding w3-xxlarge" ></div>
                    <input type="hidden" value=${username} name="username" style="display: none" >

                    <div class="w3-quarter" data-tilt>
                        <div class="w3-container w3-blue w3-padding-16" style="height: 150px">
                            <div class="w3-right"><i class="fa fa-male w3-xxxlarge"></i></div>
                            <div class="w3-left">
                                <h3>输入学生姓名</h3>
                            </div>
                            <div class="w3-clear"></div>
                            <input class="w3-input w3-text" name="studentname" type="text" >
                        </div>
                    </div>
                    <div class="w3-quarter" data-tilt>
                        <div class="w3-container w3-orange w3-padding-16 w3-text-white" style="height: 150px">
                            <div class="w3-right"><i class="fa fa-book w3-xxxlarge"></i></div>
                            <div class="w3-left">
                                <h3>输入课程</h3>
                            </div>
                            <div class="w3-clear"></div>
                            <input class="w3-input w3-text" name="classname" type="text" >
                        </div>
                    </div>
                <div class="w3-bar w3-row-padding w3-xxlarge" ></div>
                    <div class="w3-quarter" data-tilt>
                        <div class="w3-container w3-teal w3-padding-16" style="height: 150px">
                            <div class="w3-right"><i class="fa fa-flag w3-xxxlarge"></i></div>
                            <div class="w3-left">
                                <h3>输入成绩</h3>
                            </div>
                            <div class="w3-clear"></div>
                            <input class="w3-input w3-text" name="grade" type="text" >
                        </div>
                    </div>
                    <div class="w3-quarter" data-tilt>
                        <div class="w3-container w3-red w3-padding-16" style="height: 150px">
                            <input class=" w3-input w3-red w3-text-white w3-xxxlarge" type="submit" value="确认增加" >
                        </div>
                    </div>
            </form>
        </div>
        <form action="AllGrade" method="post" target="_blank">
            <div class="w3-quarter"  data-tilt>
                <div class="w3-padding-16"></div>
                <input  name="username" value="${username}" style="display: none">
                <input class=" w3-input w3-botton w3-deep-purple w3-text-white w3-xxlarge " type="submit" value="查询所有成绩" >
            </div>
        </form>
    </div>
    <hr>

    <!-- $# recent comments -->
    <div id = "alter6" class="w3-container">
<%--        <h5>Recent Comments</h5>--%>
<%--        <div class="w3-row">--%>
<%--            <div class="w3-col m2 text-center">--%>
<%--                <img class="w3-circle" src="/firstdemo/images/avatar3.png" style="width:96px;height:96px">--%>
<%--            </div>--%>
<%--            <div class="w3-col m10 w3-container">--%>
<%--                <h4>John <span class="w3-opacity w3-medium">Sep 29, 2014, 9:12 PM</span></h4>--%>
<%--                <p>Keep up the GREAT work! I am cheering for you!! Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><br>--%>
<%--            </div>--%>
<%--        </div>--%>

<%--        <div class="w3-row">--%>
<%--            <div class="w3-col m2 text-center">--%>
<%--                <img class="w3-circle" src="/firstdemo/images/avatar1.png" style="width:96px;height:96px">--%>
<%--            </div>--%>
<%--            <div class="w3-col m10 w3-container">--%>
<%--                <h4>Bo <span class="w3-opacity w3-medium">Sep 28, 2014, 10:15 PM</span></h4>--%>
<%--                <p>Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><br>--%>
<%--            </div>--%>
<%--        </div>--%>
    </div>
    <br>
    <!-- $# show page list -->
    <div id = "alter7" class="w3-container w3-dark-grey w3-padding-32">
        <div class="w3-row">
            <div class="w3-container w3-third">
                <h5 class="w3-bottombar w3-border-green">Demographic</h5>
                <p>Language</p>
                <p>Country</p>
                <p>City</p>
            </div>
            <div class="w3-container w3-third">
                <h5 class="w3-bottombar w3-border-red">System</h5>
                <p>Browser</p>
                <p>OS</p>
                <p>More</p>
            </div>
            <div class="w3-container w3-third">
                <h5 class="w3-bottombar w3-border-orange">Target</h5>
                <p>Users</p>
                <p>Active</p>
                <p>Geo</p>
                <p>Interests</p>
            </div>
        </div>
    </div>

    <!-- Footer -->
    <footer class="w3-container w3-padding-16 w3-light-grey">
        <h4>FOOTER</h4>
        <p>Powered by <a href="https://www.w3schools.com/w3css/default.asp" target="_blank">w3.css + BUAA</a></p>
    </footer>

    <!-- End page content -->
</div>

<script>
    // Get the Sidebar
    var mySidebar = document.getElementById("mySidebar");

    // Get the DIV with overlay effect
    var overlayBg = document.getElementById("myOverlay");

    // Toggle between showing and hiding the sidebar, and add overlay effect
    function w3_open() {
        if (mySidebar.style.display === 'block') {
            mySidebar.style.display = 'none';
            overlayBg.style.display = "none";
        } else {
            mySidebar.style.display = 'block';
            overlayBg.style.display = "block";
        }
    }

    // Close the sidebar with the close button
    function w3_close() {
        mySidebar.style.display = "none";
        overlayBg.style.display = "none";
    }

    //
    var b1 = document.getElementById("lookup");
    var b2 = document.getElementById("post");
    var b3 = document.getElementById("userlist");
    var b4 = document.getElementById("ppt");
    var b5 = document.getElementById("comment");
    var b6 = document.getElementById("quit");
    var b7 = document.getElementById("info");
    //
    function display(id){
        var traget=document.getElementById(id);
        if(traget.style.display==="none"){
            traget.style.display="block";
        }else{
            ;
        }
    }

    function hide(id){
        var traget=document.getElementById(id);
        if(traget.style.display==="none"){
            ;
        }else{
            traget.style.display="none";
        }
    }

    function activebar(id){
        var obj = document.getElementById(id);
        obj.className += ' w3-blue';
    }

    function negtivebar(id){
        var obj = document.getElementById(id);
        obj.className = "w3-bar-item w3-button w3-padding";
    }


    window.onload = function (){
        display("alter1");
        hide("alter2");
        hide("alter3");
        hide("alter4");
        hide("alter5");
        activebar("lookupbar");
    }


    b1.onclick = function (){
        display("alter1");
        hide("alter2");
        hide("alter3");
        hide("alter4");
        hide("alter5");
        activebar("lookupbar");
        negtivebar("postbar");
        negtivebar("userlistbar");
        negtivebar("pptbar");
        negtivebar("commentbar");
        negtivebar("infobar");
    }
    b2.onclick = function (){
        display("alter2");
        hide("alter1");
        hide("alter3");
        hide("alter4");
        hide("alter5");
        negtivebar("lookupbar");
        activebar("postbar");
        negtivebar("userlistbar");
        negtivebar("pptbar");
        negtivebar("commentbar");
        negtivebar("infobar");
    }
    b3.onclick = function (){
        display("alter3");
        hide("alter1");
        hide("alter2");
        hide("alter4");
        hide("alter5");
        negtivebar("lookupbar");
        negtivebar("postbar");
        activebar("userlistbar");
        negtivebar("pptbar");
        negtivebar("commentbar");
        negtivebar("infobar");
    }
    b4.onclick = function (){
        display("alter4");
        hide("alter1");
        hide("alter3");
        hide("alter2");
        hide("alter5");
        negtivebar("lookupbar");
        negtivebar("postbar");
        negtivebar("userlistbar");
        activebar("pptbar");
        negtivebar("commentbar");
        negtivebar("infobar");
    }
    b5.onclick = function (){
        display("alter5");
        hide("alter1");
        hide("alter2");
        hide("alter3");
        hide("alter4");
        negtivebar("lookupbar");
        negtivebar("postbar");
        negtivebar("userlistbar");
        negtivebar("pptbar");
        activebar("commentbar");
        negtivebar("infobar");
    }

    //b6 --> quit

    b7.onclick = function (){
        display("alter6");
        hide("alter1");
        hide("alter2");
        hide("alter3");
        hide("alter4");
        hide("alter5");
        negtivebar("lookupbar");
        negtivebar("postbar");
        negtivebar("userlistbar");
        negtivebar("pptbar");
        negtivebar("commentbar");
        activebar("infobar");
    }
</script>

<script type="text/javascript" src="/firstdemo/JS/vanilla-tilt.js"></script>

</body>
</html>